import React, { Component } from 'react'
import { connect } from 'react-redux'

class GlobalTitle extends Component {
  render() {
    const { title, color_theme, screen } = this.props
    const prefix = screen === 20 ? '复习课程 | ' : ''
    const _className = color_theme === 'red' ? 'global_title red' : 'global_title'
    return (
      <div className={_className}> { prefix + title } </div>
    )
  }
}
const mapStateToProps = (state) => {
  return {
    screen: state.MainScreenState.screen,
    title: state.MainScreenState.info.title,
    color_theme: state.MainScreenState.info.color_theme
  }
}

export default connect(mapStateToProps)(GlobalTitle)
